package jackson.src.day02;

/*
 * Author: JacksonCoder
 * FileName: classExtends
 * Version: 1.0.0
 */
public class classExtends {
    public static void main(String[] args) {
        System.out.println("this is start!!!");
        B b = new B();
        b.setName("Jackson");
        b.setAge(141);
        System.out.println(b.hello());
        System.out.println(b.hello(154));

    }
}

class A {
    //private String name;     继承类 无法使用这个变量
    protected String name;

//    private int age;
    protected int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

class B extends A {

    public String hello(){
        return "Hello, " + name ;
    }

    public String hello(int age){
        return "Hello, " + name + " "  +  super.age;
    }


}

